#ifndef STOCK20_H
#define STOCK20_H
#include<string>

class stock20
{
private:
    std::string company;
    int share;
    double share_val;
    double total_val;
    void set_tot(){total_val = share*share_val;}
public:
    stock20();
    stock20(const std::string &co,long n=0,double pr=0.0);
    ~stock20();
    void buy(long num,double price);
    void sell(long num,double price);
    void update(double price);
    void show() const;
    const stock20 &topval(const stock20 &s) const;//这个成员函数返回一个对象，参数也是一个对象
};

#endif // STOCK20_H
